/**
 * 
 */
package com.xbang.attendance.web.action.system.facilitator;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.xbang.attendance.entity.system.FareFacilitator;
import com.xbang.attendance.entity.system.MaintenanceStation;
import com.xbang.attendance.entity.system.Warehouse;
import com.xbang.attendance.service.SystemService;
import com.demo2do.lighturl.annotation.Action;
import com.xbang.core.struts.support.BaseActionSupport;

/**
 * @author dev.zhang
 * 
 */
public class FacilitatManager extends BaseActionSupport {

	private static final long serialVersionUID = 6843098369301424790L;

	private static final Log logger = LogFactory.getLog(FacilitatManager.class);

	private FareFacilitator fareFacilitator ;

	private Integer id;

	@Autowired
	private SystemService systemService;

	@Action("/system/facilitator/add")
	public String add() throws Exception {
		return "detail";
	}

	@Action("/system/facilitator/${id}/edit")
	public String edit() throws Exception {
		if (null == fareFacilitator && id != null) {
			fareFacilitator = (FareFacilitator) systemService.getObject(FareFacilitator.class, id);
		}
		return "detail";
	}

	@Action("/system/facilitator/save")
	public String save() throws Exception {
		if (null != fareFacilitator) {
			systemService.save(fareFacilitator);
		}
		return "r:/system/facilitator";
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the fareFacilitator
	 */
	public FareFacilitator getFareFacilitator() {
		return fareFacilitator;
	}

	/**
	 * @param fareFacilitator
	 *            the fareFacilitator to set
	 */
	public void setFareFacilitator(FareFacilitator fareFacilitator) {
		this.fareFacilitator = fareFacilitator;
	}

	/**
	 * @param systemService
	 */
	public void setSystemService(SystemService systemService) {
		this.systemService = systemService;
	}

}
